-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Better Handling of FrameButton post actions #1053
Feat: Better Handling of FrameButton post actions #1053
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -95,6 +95,7 @@ export type FrameButtonMetadata = | |||
| { | |||
action?: 'post' | 'post_redirect'; | |||
label: string; | |||
postUrl?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this part of the Frame Spec? And where is this writtend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per Button Actions, we are told that a post
should send an HTTP request to the button's post_url
.
But as currently configured, getFrameMetadata
does not set a fc:frame:button:[id]:post_url
property for post actions, only tx actions:
if (buttons) {
buttons.forEach((button, index) => {
metadata[`fc:frame:button:${index + 1}`] = button.label;
if (button.action) {
metadata[`fc:frame:button:${index + 1}:action`] = button.action;
}
if (button.target) {
metadata[`fc:frame:button:${index + 1}:target`] = button.target;
}
if (button.action && button.action === 'tx' && button.postUrl) {
metadata[`fc:frame:button:${index + 1}:post_url`] = button.postUrl;
}
});
}
The above change to FrameButtonMetadata
is required for strict type-checking of the getFrameMetadata
logic.
@brendan-defi is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
What changed? Why?
FrameButtonMetadata
to allow custompostUrl
propertygetFrameMetadata
to handle custompostUrl
s on Frame ButtonsNotes to reviewers
How has it been tested?